package com.zmn.brs.task.runner;

import com.zmn.brs.drools.cache.DroolsCache;
import com.zmn.brs.services.interfaces.drools.RuleDroolsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 类描述：启动时初始化安全监控的规则Drools
 *
 * @author zhangyao
 * @since 2021/05/14 17:06
 */
@Slf4j
@Component
public class DroolsInitRunner implements ApplicationRunner {

    @Resource
    private RuleDroolsService droolsService;

    @Override
    public void run(ApplicationArguments args) throws Exception {

        DroolsCache.initDrools(droolsService);

    }

}
